package com.ushio.gougouwangguo.controller;

import com.ushio.commonmodule.pojo.result.Result;
import com.ushio.gougouwangguo.entity.mysql.MaterialsQuality;
import com.ushio.gougouwangguo.service.IMaterialsQualityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 物资品质表 前端控制器
 * </p>
 *
 * @author 张文凯
 * @since 2025-10-14
 */
@RestController
@RequestMapping("/materiasQuality")
public class MaterialsQualityController {

    @Autowired
    IMaterialsQualityService iMateriasQualityService;

    @GetMapping("/all")
    private Result<List<MaterialsQuality>> getMateriasQualityAll(){
        try{

            List<MaterialsQuality> materiasQualities = iMateriasQualityService.getMateriasQualityAll();

            return Result.success(materiasQualities);

        }catch (Exception e){

            e.printStackTrace();

            return Result.fail();
        }
    }

}
